package com.juzhencms.apps;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.juzhencms.apps.base.common.util.MD5Util;

import uk.org.lidalia.sysoutslf4j.context.SysOutOverSLF4J;


@SpringBootApplication
@EnableScheduling //开启定时任务
@EnableAsync   //开启异步任务
@EnableCaching //开启缓存
@ServletComponentScan(basePackages = "com.juzhencms.apps")
public class Application {
	
	public static void main(String[] args) {
		//设置缓存目录,用java虚拟机临时目录加上当前项目目录的md5字符串，确保每个项目的缓存目录不同
		System.setProperty("ehcache.disk.store.dir", System.getProperty("java.io.tmpdir")+"/"+MD5Util.md5(Application.class.getResource("/").getPath()));
		//system日志重定向写入到springboot日志
		SysOutOverSLF4J.sendSystemOutAndErrToSLF4J();
		SpringApplication.run(Application.class, args);	
		
	}
}
